<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Refresh" content="3;url=index.html">
    <title>05-响应对象之定时跳转</title>
</head>
<body>

<span id="spn">3</span>秒后跳转，如果没有跳转，<a href="index.html">请点击</a>

</body>
<script>

    window.setInterval("showCount()",1000);

    function showCount() {
        var count = document.getElementById("spn").innerText;
        if (count <= 1) {
            return;
        }
        count--;
        document.getElementById("spn").innerText = count;
    }

</script>
</html>